package com.ruoyi.system.api.factory;

import com.ruoyi.system.api.RemoteSysDeptService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

import java.util.List;

@Component
public class RemoteSysDeptFallbackFactory implements FallbackFactory<RemoteSysDeptService> {

    private static final Logger log = LoggerFactory.getLogger(RemoteSysDeptFallbackFactory.class);

    @Override
    public RemoteSysDeptService create(Throwable throwable)
    {
        log.error("用户服务调用失败:{}", throwable.getMessage());
        return new RemoteSysDeptService()
        {
            @Override
            public List<?> listgetid(Long deptId, String source)
            {
                return null;
            }
        };
    }
}
